Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#1491) Cloning item drafts before saving in exit app flow #1617

Closed
wants to merge 1 commit into from

Conversation

rsilvr
Copy link
Contributor

@rsilvr rsilvr commented Feb 18, 2024

Description (longer than the correction)

I replayed exactly the scenario described by the issue author in this comment and tracked the issue to a mutation that happens during the saveMultipleRequests action, throwing an error:

image

As explained here this should originate if the object being mutated explicitly has a protection against adding new properties. I never encountered this before, but maybe it's something by design of react-redux?

Inspecting the objects during debug it seems to be the case:
image

This problem doesn't happen when closing just the tab, which uses the saveRequest action instead. There the collection and the tab are cloned before entering transformRequestToSaveToFilesystem function, which avoids any mutation protections.
image

Applying the same for saveMultipleRequests solved the issue.

Contribution Checklist:

  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Closes #1491

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

@rsilvr rsilvr closed this Feb 19, 2024
@rsilvr rsilvr deleted the fix/unsaved-changes branch February 28, 2024 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Save" in "Unsaved changes" doesn't do anything
1 participant